package com.borya;


import org.junit.Before;
import org.junit.Test;

import com.alibaba.fastjson.JSONObject;
import com.borya.framework.annotation.Autowired;
import com.borya.framework.core.ServerBeanFactory;
import com.borya.framework.core.ServerInitializer;
import com.borya.service.server.impl.SendMailServiceImpl;

public class test_mail {
	@Before
	public void before() throws Exception {
		ServerInitializer init = new ServerInitializer();
		init.init();
		ServerBeanFactory.getInstance().registerBean(this, "dddd");
	}
	@Autowired("sendMailServiceImpl")
	private SendMailServiceImpl sendMailServiceImpl;
	
	public SendMailServiceImpl getSendMailServiceImpl() {
		return sendMailServiceImpl;
	}
	
	@Test
	public void test_sendMail() {
		JSONObject json = new JSONObject();
		StringBuilder sb = new StringBuilder();
		sb.append("<p><span>").append("系统订单号:").append("123123132").append("</span></p>")
		  .append("<p><span>").append("商户订单号:").append("123123132").append("</span></p>")
		  .append("<p><span>").append("支付方式    :").append("123123132").append("</span></p>")
		  .append("<p><span>").append("单价:").append("123123132").append("元</span></p>")
		  .append("<p><span>").append("购买数量:").append("123123132").append("个</span></p>")
		  .append("<p><span>").append("支付金额:").append("123123132").append("元</span></p>")
		  .append("<p><span>").append("支付时间:").append("123123132").append("</span></p>")
		  .append("<p><span>").append("收货人姓名:").append("123123132").append("</span></p>")
		  .append("<p><span>").append("收货人电话:").append("123123132").append("</span></p>")
		  .append("<p><span>").append("收货人地址:").append("123123132").append("</span></p>")
		  .append("<p><span>").append("邮编:").append("123123132").append("</span></p>");
		String info = "卡盟包申请";
		json.put("body", sb.toString());
		json.put("content", info);
		
		String result = getSendMailServiceImpl().sendMail(json);
		System.out.println(result);
	}
	
}
